package com.wuhao.shootclient.util.net;

import java.math.BigInteger;

public class FeelTheBase {

    public static String hex2Str(byte[] data) {
        if (data == null || data.length < 1)
            return null;
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < data.length; i++) {
            String hex = Integer.toHexString(data[i] & 0xFF);
            if (hex.equals("3c")){
                hex = "<";
            }
            else if (hex.equals("3e")){
                hex = ">";
            }
            else if (hex.equals("30")){
                hex = "0";
            }
            else if (hex.equals("31")){
                hex = "1";
            }
            else if (hex.equals("32")){
                hex = "2";
            }
            else if (hex.equals("33")){
                hex = "3";
            }
            else if (hex.equals("34")){
                hex = "4";
            }
            else if (hex.equals("35")){
                hex = "5";
            }
            else if (hex.equals("36")){
                hex = "6";
            }
            else if (hex.equals("37")){
                hex = "7";
            }
            else if (hex.equals("38")){
                hex = "8";
            }
            else if (hex.equals("39")){
                hex = "9";
            }
            else if (hex.equals("28")){
                hex = "-";
            }
            else if (hex.equals("29")){
                hex = "-";
            }
            else if (hex.equals("0d")){
                hex = "cr";
            }
            else if(hex.equals("0a")){
                hex = "le";
            }
            sb.append(hex);
        }

        return sb.toString().trim();
    }


}
